<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Es6</title>
</head>
<body>
    <script>
        // ES6定义类 class
        class Phone{
            // 构造函数
            constructor(brand,price){
                this.brand = brand;
                this.price = price;
            }
            // 添加方法
            call(){
                console.log('可以打电话');
            }

            // 添加静态的属性和方法,使用 类名.属性名读取
            static color = 'white';
            // 静态方法是属于类的， 类名.方法名调用
            static say(){
                console.log('say');
            }
        }
        let p1 = new Phone('华为mate30pro',5000);
        p1.call();
        console.log(p1.price);

        console.log(Phone.color);
        Phone.say();

        console.log(Math.random())
        // new Object()
        // Object.create()
        // Object.assign();

    </script>
</body>
</html>